<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <f:view>
	<h:head>
		<p:resources />
		<title>Cadastro de Medicamentos</title>
	</h:head>
<body>
	
	
	
	<h:form prependId="false" >
		
		<p:messages id="msgs" showDetail="true"/>
		
		<p:panel header="Medicamentos" id="panelDadosPessoais">
			<h:panelGrid columns="2" columnClasses="label, value"
				styleClass="grid">
				<h:outputLabel id="labelNome" for="nome" value="Medicamento* " />
				<p:inputText id="nome" value="#{medicamentoBean.medicamento.nome}" 
					required="true"/>
				
				<h:outputLabel id="labeldesc" for="desc" value="Descricao* " />
				<p:inputText id="desc" value="#{medicamentoBean.condicaoRefrigeracao.descricao}" 
					required="true"/>				
				
				<h:outputLabel for="tipo" value="Tipo " styleClass="OutputLabelCampo" /> 
				<h:selectOneMenu id="tipo" value="#{medicamentoBean.medicamento.tipo}"
						title="Tipo">
						<f:selectItem itemLabel="Generico" itemValue="Generico"></f:selectItem>
						<f:selectItem itemLabel="Específico" itemValue="Especifico"></f:selectItem>
				</h:selectOneMenu>
				
				<h:outputLabel id="ressup" for="ressup" value="Pnt Ressup* " />
				<p:inputText id="ressup" value="#{medicamentoBean.medicamento.PtoRessuprimento}" 
					required="true"/>
				
				<h:outputLabel id="prvenda" for="prvenda" value="Preco Venda* " />
				<p:inputText id="prVenda" value="#{medicamentoBean.medicamento.precovenda}" 
					required="true"/>
				
				<h:outputLabel id="dosagem" for="dosagem" value="Dosagem* " />
				<p:inputText id="dosagem" value="#{medicamentoBean.dosagem.quantidade}" 
					required="true"/>	
				
				<h:outputLabel for="DosUnidade" value="Unidade Dosagem" styleClass="OutputLabelCampo" /> 
				<h:selectOneMenu id="DosUnidade" value="#{medicamentoBean.dosagem.unidadeDos}"
						title="Tipo">
						<f:selectItem itemLabel="ml" itemValue="ml"></f:selectItem>
						<f:selectItem itemLabel="grama" itemValue="grama"></f:selectItem>
						<f:selectItem itemLabel="envelope" itemValue="envelope"></f:selectItem>
						<f:selectItem itemLabel="cápsula" itemValue="cápsula"></f:selectItem>
				</h:selectOneMenu>
				
				<h:outputLabel for="embalagem" value="Embalagem " styleClass="OutputLabelCampo" /> 
				<h:selectOneMenu id="embalagem" value="#{medicamentoBean.embalagem.formato}"
						title="Tipo">
						<f:selectItem itemLabel="Caixa" itemValue="Caixa"></f:selectItem>
						<f:selectItem itemLabel="Frasco" itemValue="Frasco"></f:selectItem>
						<f:selectItem itemLabel="Cartela" itemValue="Cartela"></f:selectItem>
				</h:selectOneMenu>
				
				<h:outputLabel id="qtdCont" for="qtdCont" value="Qtd Contida* " />
				<p:inputText id="qtdCont" value="#{medicamentoBean.embalagem.qtdContida}" 
					required="true"/>
				
				<h:outputLabel for="DosEmb" value="Unidade Embalagem" styleClass="OutputLabelCampo" /> 
				<h:selectOneMenu id="DosEmb" value="#{medicamentoBean.embalagem.unidadeEmb}"
						title="Tipo">
						<f:selectItem itemLabel="ml" itemValue="ml"></f:selectItem>
						<f:selectItem itemLabel="grama" itemValue="grama"></f:selectItem>
						<f:selectItem itemLabel="envelope" itemValue="envelope"></f:selectItem>
						<f:selectItem itemLabel="cápsula" itemValue="cápsula"></f:selectItem>
				</h:selectOneMenu>
				
			</h:panelGrid>
		</p:panel>
		
		<p:commandButton value="Salvar" ajax="false"
	   			actionListener="#{medicamentoBean.salvarMedicamento}" />
	   	<p:commandButton action="#{medicamentoBean.irParaConsultarMedicamento}" value="Voltar"
						immediate="true" ajax="false" />	   			   
	</h:form>
</body>
</f:view>
</html>

